This invention relates to semaphore mechanisms for data processing systems.
More specifically, the invention is concerned with a data processing system having a number of processing nodes, interconnected by a communication network, wherein the nodes have access to shared resources such as shared memory.
A semaphore mechanism is a means for ensuring that only one processing node can access a shared resource at any given time. In one known form of semaphore mechanism, each shared resource (e.g. each area of the shared memory) has a semaphore location associated with it. Whenever a node wishes to access a shared resource, it first increments and tests the associated semaphore location, to find out whether another node is already accessing that resource. Conversely, when the node has completed its access to a shared resource, it tests and decrements the appropriate semaphore location. Each node holds local copies of all the semaphore locations, and to ensure that all these copies are kept consistent, each semaphore action requires sending a semaphore message over the network to initiate the required operation on each local copy of the semaphore location.
In such a system, it is necessary to provide some way of synchronising semaphore operations, to ensure that each node applies all such operations in the same chronological sequence, regardless of which node originated them. One way of achieving this is to broadcast the semaphore messages to all the nodes in the system, including the originating nodes. These messages are distributed to the nodes in such a way that all the nodes receive the messages in the same sequence. This sequence then defines a unique chronology for the semaphore operations.
A problem with this is that a process running in a node must be suspended each time it initiates a semaphore operation, until the associated semaphore message has been "turned round" (i.e. received back from the network) so that the process can be sure of the correct chronology for the operation. This can result in significant delays in performing the semaphore operations.
The object of the present invention is to provide a way of reducing the suspension time associated with semaphore operations, and hence to speed up the operation of the system.